//参考链接： https://b23.tv/ZVCr7J9
function tpljs(tplStr) {
    const compile = (tplStr) => {
        return tplStr.replace(/&lt;|&gt;/g, (value) => value === '&lt;' ? '<' : '>' )
        .replace(/\{%|%\}/g, (value) => value === '{%' ? '`;' : 'str+=`')
        .replace(/\s*(`)\s*/g, '$1');
    }
    const fn = new Function('data', 'let str=""; with(data){ str+=`'+compile(tplStr)+'`; return str; }');
    return function render(data) {
        return fn(data);
    }
}